
import React, {
  Component,
  StyleSheet,
  Text,
  View,
  TouchableOpacity,
  SwitchIOS,
} from 'react-native';

var Title =require('./Title');
var query = require('./Query').query;

class NotifySetting extends Component{

  constructor(props){
    super(props);
    this.user = this.props.user;
    this.state = {
      recv_new_msg:false,
      dis_detail_msg:true,
    }
  }


  _onPressReturn(){
    this.props.navigator.pop();
  }

  render(){
    return(
      <View style={styles.container}>
        <Title title={{left:"返回",center:"通知提醒",
              leftAct:this._onPressReturn.bind(this)}}></Title>

          <View style={{backgroundColor:'#fff',height:50,flexDirection:'row',justifyContent:'space-between',alignItems:'center'}}>
            <Text style={styles.text}>接受新消息通知</Text>
            <SwitchIOS style={{marginRight:20}} value={this.state.recv_new_msg}
              onValueChange={(value)=>{this.setState({recv_new_msg:value})}}/>
          </View>

          <Text style={{marginTop:15,height:50,marginLeft:20,marginRight:55,fontSize:14,color:'#bbbbbb'}}>
            如果你要关闭或者开启抱抱网新消息通知,请在iPhone的"设置" - "通知"功能中，找到应用程序“抱抱网”更改。
          </Text>

          <View style={{backgroundColor:'#fff',height:50,flexDirection:'row',justifyContent:'space-between',alignItems:'center'}}>
            <Text style={styles.text}>通知显示消息详情</Text>
            <SwitchIOS style={{marginRight:20}} value={this.state.dis_detail_msg}
              onValueChange={(value)=>{this.setState({dis_detail_msg:value})}}/>
          </View>

          <Text style={{marginTop:15,height:50,marginLeft:20,marginRight:55,fontSize:14,color:'#bbbbbb'}}>
            关闭后，当接收到抱抱网消息时，通知提示将不显示发信人和内容提要。
          </Text>

      </View>
    )

  }
}

/**
 * 定义本模块的样式表
 * @type {*|{type, property}|{panHandlers}|Object|{duration, create, update}|Config}
 */
const styles = StyleSheet.create({
  container: {
    backgroundColor: '#eeeeee',
    flex: 1,
  },
  text:{
    marginLeft:20,
    fontSize:16,
    color:'#04679b',
  },
  
})

/**
 * 导出请假申请列表模块
 * @type {LeaveList}
 */
module.exports = NotifySetting;
